package com.fgr.mapper;

import com.fgr.beans.Reserve;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ReserveMapper {

    @Insert("insert into an_reserve(re_uid,re_type,re_time,re_duration) values(#{reUid},#{reType},#{reTime},#{reDuration})")
    public Integer addReserve(Reserve reserve);

//    @Select("select * from an_reserve where re_type=#{reType}")
    public List<Reserve> findReserveByTypeBg(String reType);

    @Select("select * from an_reserve where re_id=#{reId}")
    public Reserve findReserveByReId(Integer reId);

    @Delete("delete from an_reserve where re_id=#{reId}")
    public Integer deleteReserveByTypeBg(Integer reId);

    @Update("update an_reserve set re_uid=#{reUid},re_type=#{reType},re_time=#{reTime},re_duration=#{reDuration} where re_id=#{reId}")
    public Integer UpdateReserve(Reserve reserve);

    }
